package com.example.travel.service;

import com.example.travel.mapper.UserMapper;
import com.example.travel.pojo.orm.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper mapper;

    public User getUserById(int userId){
        return mapper.getUserById(userId);
    }

    public int addUser(User user){
        return mapper.addUser(user);
    }

    public User getLastUser(){
        return mapper.getLastUser();
    }

    public User getUserByName(String userName){
        return mapper.getUserByName(userName);
    }

    public List<User> getUserByLikeName(String userName){
        return mapper.getUserByLikeName(userName);
    }

    public User checkPassword(User user){
        return mapper.checkPassword(user);
    }

    public int updateUser(User user){
        return mapper.updateUser(user);
    }

    public int deleteUser(int userId){
        return mapper.deleteUser(userId);
    }
}
